package com.dehui.traders.ui.market.platedetail;


import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dehui.traders.R;
import com.dehui.traders.bean.PlateListBean;
import com.dehui.traders.utils.BaseRecyclerAdapter;
import com.dehui.traders.utils.SmartViewHolder;

import me.goldze.mvvmhabit.utils.Utils;

public class PlateDetailAdapter extends BaseRecyclerAdapter<PlateListBean.PlateData> {

    public PlateDetailAdapter() {
        super(R.layout.list_item_plate_detail_item);
    }

    @Override
    protected void onBindViewHolder(SmartViewHolder holder, PlateListBean.PlateData model, int position) {
        LinearLayout llTop = holder.findViewById(R.id.ll_top);
        TextView tvTitle = holder.findViewById(R.id.tv_title);
        TextView tvRate = holder.findViewById(R.id.tv_rate);
        TextView tvName = holder.findViewById(R.id.tv_name);

        llTop.setVisibility(position == 0 ? View.VISIBLE : View.GONE);
        tvTitle.setText(model.title);
        tvRate.setText(Utils.StringToString(model.rate) + "%");
        tvName.setText(model.name);

    }
}
